package own.stu.jobgib.playown.fsm.easyStates.api;

import lombok.Getter;
import own.stu.jobgib.playown.fsm.easyStates.common.Utils;

import java.util.Date;

@Getter
public abstract class AbstractEvent implements Event {

    protected String name;
    protected long timestamp;

    protected AbstractEvent() {
        this.name = Utils.DEFAULT_EVENT_NAME;
        timestamp = System.currentTimeMillis();
    }

    protected AbstractEvent(final String name) {
        this.name = name;
        timestamp = System.currentTimeMillis();
    }

    @Override
    public String toString() {
        return "Event" +
                "{name='" + name + '\'' +
                ", timestamp=" + new Date(timestamp) +
                '}';
    }
}
